﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Windows="clr-namespace:MixModes.Synergy.Web.VisualFramework.Windows"
                    xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
                    xmlns:behaviors="clr-namespace:MixModes.Synergy.Web.VisualFramework.Behaviors"
                    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                    xmlns:Controls1="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit" xmlns:Controls2="clr-namespace:MixModes.Synergy.Web.VisualFramework.Controls">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/MixModes.Synergy.Web.VisualFramework;component/Themes/Brushes.xaml" />
        <ResourceDictionary Source="/MixModes.Synergy.Web.VisualFramework;component/Themes/Buttons.xaml" />
        <ResourceDictionary Source="/MixModes.Synergy.Web.VisualFramework;component/Themes/TabItems.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="DockPointBorder"
           TargetType="Border">
        <Setter Property="BorderBrush"
                Value="Transparent" />
        <Setter Property="BorderThickness"
                Value="2" />
        <Setter Property="HorizontalAlignment"
                Value="Center" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
    </Style>

    <Style TargetType="Image" x:Key="DefaultImageStyle">
        <Setter Property="Stretch"
                Value="None" />
    </Style>    

    <Style TargetType="Windows:DocumentContainer">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Windows:DocumentContainer">
                    <Grid>
                        <!-- Document Content -->
                        <Controls:TabControl x:Name="PART_DOCUMENTS"
                                             ItemsSource="{TemplateBinding Documents}">
                            <Controls:TabControl.Resources>
                                <Style TargetType="Controls:TabItem">
                                    <Setter Property="Background"
                                            Value="{StaticResource DockPaneBackgroundBrush}" />
                                    <Setter Property="Foreground"
                                            Value="{StaticResource DockPaneHeaderForegroundBrush}" />
                                    <Setter Property="Template"
                                            Value="{StaticResource DockedContentTabItem}" />
                                </Style>
                            </Controls:TabControl.Resources>                            
                        </Controls:TabControl>

                        <!-- Content Presenter -->
                        <ContentPresenter />

                        <Grid x:Name="PART_DOCK_POINTS"
                              Visibility="Collapsed">
                            <Grid>
                                <Image Source="/MixModes.Synergy.Web.VisualFramework;component/Resources/DockHexagon.png"
                                       Style="{StaticResource DefaultImageStyle}" />
                                <Grid HorizontalAlignment="Center"
                                      VerticalAlignment="Center">
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <Border Style="{StaticResource DockPointBorder}"
                                            Grid.Row="0"
                                            Grid.Column="1">
                                        <i:Interaction.Behaviors>
                                            <behaviors:ContentDockBehavior DockPoint="Top" />
                                        </i:Interaction.Behaviors>
                                        <Image Source="/MixModes.Synergy.Web.VisualFramework;component/Resources/SplitTop.png" 
                                               Style="{StaticResource DefaultImageStyle}"/>
                                    </Border>
                                    <Border Style="{StaticResource DockPointBorder}"
                                            Grid.Row="1"
                                            Grid.Column="0">
                                        <i:Interaction.Behaviors>
                                            <behaviors:ContentDockBehavior DockPoint="Left" />
                                        </i:Interaction.Behaviors>
                                        <Image Source="/MixModes.Synergy.Web.VisualFramework;component/Resources/SplitLeft.png"
                                               Style="{StaticResource DefaultImageStyle}" />
                                    </Border>
                                    <Border Style="{StaticResource DockPointBorder}"
                                            Grid.Row="1"
                                            Grid.Column="2">
                                        <i:Interaction.Behaviors>
                                            <behaviors:ContentDockBehavior DockPoint="Right" />
                                        </i:Interaction.Behaviors>
                                        <Image Source="/MixModes.Synergy.Web.VisualFramework;component/Resources/SplitRight.png"
                                               Style="{StaticResource DefaultImageStyle}" />
                                    </Border>
                                    <Border Style="{StaticResource DockPointBorder}"
                                            Grid.Row="1"
                                            Grid.Column="1">
                                        <i:Interaction.Behaviors>
                                            <behaviors:ContentDockBehavior DockPoint="Content" />
                                        </i:Interaction.Behaviors>
                                        <Image Source="/MixModes.Synergy.Web.VisualFramework;component/Resources/DockCenter.png"
                                               Style="{StaticResource DefaultImageStyle}" />
                                    </Border>
                                    <Border Style="{StaticResource DockPointBorder}"
                                            Grid.Row="2"
                                            Grid.Column="1">
                                        <i:Interaction.Behaviors>
                                            <behaviors:ContentDockBehavior DockPoint="Bottom" />
                                        </i:Interaction.Behaviors>
                                        <Image Source="/MixModes.Synergy.Web.VisualFramework;component/Resources/SplitBottom.png"
                                               Style="{StaticResource DefaultImageStyle}" />
                                    </Border>
                                </Grid>
                            </Grid>
                        </Grid>

                        <!-- Illustrates future window docked position 
                 NOTE: IsHitTestVisible must be set to false for this dock pane -->
                        <Controls1:DockPanel x:Name="PART_DOCK_ILLUSTRATION"
                                             LastChildFill="false"
                                             IsHitTestVisible="false" />

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
